package com.leve.admin.service;

import com.leve.admin.domain.ResultBase;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import static org.springframework.http.MediaType.APPLICATION_JSON_UTF8_VALUE;

@FeignClient(value = "shop", path = "v1/")
public interface ShopService {
    @ApiOperation("web端查询订单列表")
    @GetMapping(value = "order/findorders")
    ResultBase findOrders(@RequestParam(value = "statusId") String statusId, @RequestParam(value = "name") String name, @RequestParam(value = "page") int page, @RequestParam(value = "size") int size);

    @ApiOperation("获取订单状态-admin-web")
    @GetMapping("order/getstatus")
    ResultBase getstatus();


    @ApiOperation("获取订单状态-admin-web")
    @GetMapping("order/getremit_status")
    ResultBase getremitStatus();


    @ApiOperation("upc转账-admin-web")
    @GetMapping(value = "pay/upctrx")
    @ResponseBody
    ResultBase upcTransaction();


    @ApiOperation("提现中")
    @GetMapping(value = "pay/remit_ing/{gid}")
    @ResponseBody
    ResultBase remit_ing(@PathVariable("gid") String gid);


    @ApiOperation("获取全部提现记录--web")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page", value = "页码，从0开始，默认值0", dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "size", value = "单页规模，默认值10", dataType = "int", paramType = "query")})
    @GetMapping("remit/getall")
    ResultBase findRemitRecord(@RequestParam(value = "name") String name,@RequestParam(value = "statusId") String statusId, @RequestParam(value = "page") int page, @RequestParam(value = "size") int size);

    @ApiOperation("提现或者退回--web")
    @GetMapping(value = "remit/remit_return")
    @ResponseBody
    ResultBase remitReturn(@RequestParam(value = "checkList") String checkList, @RequestParam(value = "id") String id, @RequestParam(value = "keyValue") String keyValue);

    @GetMapping(value = "sell/sellorders", produces = APPLICATION_JSON_UTF8_VALUE)
    ResultBase selectSellOrders(@RequestParam(value = "statusId") String statusId, @RequestParam(value = "name") String name, @RequestParam(value = "page") int page, @RequestParam(value = "size") int size);

    @GetMapping(value = "sell/buyorders", produces = APPLICATION_JSON_UTF8_VALUE)
    ResultBase selectBuyOrders(@RequestParam(value = "statusId") String statusId, @RequestParam(value = "name") String name, @RequestParam(value = "page") int page, @RequestParam(value = "size") int size);

    @GetMapping(value = "sell/addbuy", produces = APPLICATION_JSON_UTF8_VALUE)
    ResultBase addBuy(@RequestParam(value = "keyValue") String keyValue, @RequestParam(value = "id") String id);

    @GetMapping(value = "remit/ghostbank/{gbid}", produces = APPLICATION_JSON_UTF8_VALUE)
    @ResponseBody
    ResultBase freezeGhostBank(@PathVariable("gbid") String gbid);
}
